From: Alexandre Emsenhuber Date: Sat, 26 May 2012 16:13:31 +0000 (+0200) Subject: Check validity of fetched titles and show a descriptive messages when an invalid... X-Git-Tag: 1.31.0-rc.0~23499 X-Git-Url: http://git.cyclocoop.org//%22http:/%22.attribut_html%28%24lesurls%5B%24numero%5D%29.%22/%22?a=commitdiff_plain;h=c82961b1d4cc9d9261fa60659a08106ee953f448;p=lhc%2Fweb%2Fwiklou.git Check validity of fetched titles and show a descriptive messages when an invalid title is encountered. Change-Id: I8989430db3eb817d24b5128df46942eda15eb535 --- diff --git a/includes/specials/SpecialShortpages.php b/includes/specials/SpecialShortpages.php index 195e5bf286..ee045744a8 100644 --- a/includes/specials/SpecialShortpages.php +++ b/includes/specials/SpecialShortpages.php @@ -82,7 +82,11 @@ class ShortPagesPage extends QueryPage { function formatResult( $skin, $result ) { $dm = $this->getLanguage()->getDirMark(); - $title = Title::makeTitle( $result->namespace, $result->title ); + $title = Title::makeTitleSafe( $result->namespace, $result->title ); + if ( !$title ) { + return Html::element( 'span', array( 'class' => 'mw-invalidtitle' ), + Linker::getInvalidTitleDescription( $this->getContext(), $result->namespace, $result->title ) ); + } $hlink = Linker::linkKnown( $title,